﻿@{
    var picclass = ViewData["class"] as picclass;
    var album = ViewData["album"] as picalbum;
}

@{
    ViewBag.Title = album.Title + " - 咕嘟咕嘟";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}
@section head{
    <script src="~/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="~/AdminContent/static/h-ui/js/H-ui.js"></script>
    <script src="~/AdminContent/lib/layer/2.1/layer.js"></script>
    @*<link rel="stylesheet" type="text/css" href="~/AdminContent/static/h-ui/css/H-ui.min.css" />*@
    <link rel="stylesheet" type="text/css" href="~/AdminContent/lib/Hui-iconfont/1.0.7/iconfont.css" />



    <link href="~/static/css/layui.css" rel="stylesheet" />


}

@section blurWrap{
    <div class="blurWrap" id="goods-detail">
}
@using Beauty.Model;
@using WebUI.Models;
@model bool
<!--介绍开始-->
<div class="bread-crumb" id="bread">


    <p>@picclass.ClassName：@album.Title</p>
</div>
<!--介绍结束-->
<!--详情开始-->
<div class="tempDetailWrap">
    <div class="leftWrap">
        <div class="tempImgWrap">
            @*次数用完后，仍可以看以前看过的*@
            @*@if (Model && !((List<string>)ViewData["visted_albumid"]).Contains(Html.ViewContext.RouteData.Values["id"]))
                {


                    <img id="detail_pic" src="~/images/lock.png">
                }
                else
                {
                    foreach (var item in (List<picmain>)ViewData["mains"])
                    {
                        <img id="detail_pic" src="@string.Format("{0}",item.Src)">
                    }

                }*@
            @{
                foreach (var item in (List<picmain>)ViewData["mains"])
                {
                    <img id="detail_pic" src="@string.Format("{0}",item.Src)">
                }
            }
        </div>
        <div class="tempLaw">
            <p>咕嘟咕嘟在售的所有图片皆为自行研发设计而成, 未经许可, 不得对本网站图片进行修改、复制、抄袭、剽窃、贩卖、展示、公开、散播或是将其用于任何商业目的。</p>
        </div>

        @if (ViewData["user"] != null)
            {
                user user = ViewData["user"] as user;

                if (CommonMethod.IsCollect(user.Uid, int.Parse(ViewContext.RouteData.Values["id"].ToString())))
                {
                <a class="layui-btn layui-btn-big layui-btn-normal collect-btn" href="javascript:;" id="cancle_follow"><i class="layui-icon" style="font-size:20px">&#xe600;</i> 取消收藏</a>

            }
            else
            {
                <a class="layui-btn layui-btn-big layui-btn-normal collect-btn" href="javascript:;" id="follow"><i class="layui-icon" style="font-size:20px">&#xe600;</i> 收藏</a>


            }
        }
        else
        {
            <a class="layui-btn layui-btn-big layui-btn-normal collect-btn" href="javascript:;" id="follow"><i class="layui-icon" style="font-size:20px">&#xe600;</i> 收藏</a>


        }


        <br />

    </div>
    <div class="rightWrap">






        <h3 class="relrec" style="margin-top:20px;">相关推荐</h3>
        @foreach (var item in (List<picalbum>)ViewData["recommends"])
        {

            <div class="recommendation">
                <a href="@item.AlbumId" class="rec-resume" target="_blank" data-id="@item.AlbumId">
                    <img src="@item.CoverSrc" alt="">
                </a>
                <div class="tempIntro">
                    <p style="width:200px">@item.Title</p>
                </div>
            </div>
            <br>
        }
        <!--<div class="recommendation">-->
        <!--<a href="javascript:void(0);">-->
        <!--<img src="images/temp.jpg" alt="">-->
        <!--</a>-->
        <!--<div class="tempIntro">-->
        <!--<p>word标准模板</p>-->
        <!--<span class="price">￥2.00</span>-->
        <!--</div>-->
        <!--</div>-->
    </div>

</div>
<!--详情结束-->
<style>
    body .demo-class .layui-layer-title {
        background: #c00;
        color: #fff;
        border: none;
    }

    body .demo-class .layui-layer-btn {
        border-top: 1px solid #E9E7E7;
    }

        body .demo-class .layui-layer-btn a {
            background: #333;
        }

        body .demo-class .layui-layer-btn .layui-layer-btn1 {
            background: #999;
        }

    .collect-btn {
        margin: 0 auto;
        display: table;
    }
</style>
<script>
    jQuery.noConflict();//别的js文件冲突了 这里解决下
    jQuery("#follow").click(function () {
        var dom=this;


        jQuery.post("/Follow/Follow", {action_type:1 ,albumId: @ViewContext.RouteData.Values["id"].ToString() }, function (data) {
            if (data.error_code!=0) {

                layer.alert(data.msg,{moveType :1});

            }else {
                location.reload()
            }
        },"json");
    })
    jQuery("#cancle_follow").click(function () {
        var dom=this;
        jQuery.post("/Follow/Follow", {action_type:2 ,albumId: @ViewContext.RouteData.Values["id"].ToString() }, function (data) {
            if (data.error_code!=0) {

                layer.alert(data.msg);
            }else {
                location.reload()
            }
        },"json");
    })
        </script>
